<template>
    <div class="page-100 "  style="background-color: white">
        <div class="officeheader-title">
            <p>联系方式</p>
            <p class="officeedit" @click="editClick">修改</p>
        </div>
        <div style="background-color: white;height: 30%;border-bottom: 1px solid #e5e5e5;">
            <p class="officeleft">发起人：{{username}}</p>
            <p class="officeleft ">机构-部门：{{jigoubumen}}</p>
            <p class="officeleft">联系电话：{{mobile}}</p>
            <p class="officeleft">送货地址：{{addr}}{{room}}</p>
        </div>
        <div class="officeheader-title">采购明细</div>
        <div class="mui-flex" v-for="(item,index) in dataList">
            <div class="cell3" >
                <p class="officeleft-title"> {{item.name}}{{item.brand}}{{item.typeNo}}</p>
            </div>
            <div class="cell3">
                <p class="officecenrer-title"> {{item.specName}}</p>
            </div>
            <div class="cell">
                <p class="officeright-title"> {{item.amounts}}件</p>

            </div>
        </div>
        <div class="officeheader-title">备注</div>
        <yd-cell-item>
            <yd-textarea slot="right" style="padding-left: 0.24rem;font-size: 0.2rem" placeholder="请输入备注信息"
                         maxlength="200" v-model="remark"></yd-textarea>
        </yd-cell-item>
        <yd-button size="large" type="primary" @click.native="confrimClick"
                   style="background-color:#e9b778;color:white;margin-top: 20px">确定
        </yd-button>

    </div>
</template>

<script>
    import {userInfoData} from '../../globalVariables'
    export default {
        name: "officeShowinfoandremark",
        data() {
            return {
                username:JSON.parse(localStorage.getItem(userInfoData)).name,
                jigoubumen:'',
                addr:JSON.parse(localStorage.getItem('address')),
                mobile: JSON.parse(localStorage.getItem('phone')),
                room:JSON.parse(localStorage.getItem('room')),
                dataList:JSON.parse(localStorage.getItem('officedata')),
                remark:'',
            }
        },
        methods:{
            editClick ()
            {
                this.$router.push({name: 'editAddress', params: {type: '1'}});//type 1 是办公用品 2是凭证请领


            },
            async confrimClick()//确定进入选择审核人
            {
                /**
                 * 办公用品下单传值
                 *  * applierUuid 个人的id
                 * instUuid 机构的id
                 * deptUuid部门的id
                 * contactNumber 联系电话
                 * addr 地址
                 * room房间号
                 * remark 备注信息
                 * commodities 办公用品数组 json{supplierUuid imageUrl name desc typeName specName price amounts brand typeNo description}
                 */

                localStorage.setItem('remark',JSON.stringify
                (this.remark));

                 this.$router.push({name: 'officeExamine'});
            }

        },
        created()
        {

            var jigou=JSON.parse(localStorage.getItem(userInfoData)).bankName;
            var bumen=JSON.parse(localStorage.getItem(userInfoData)).departmentName;
            console.log( JSON.parse(localStorage.getItem('officedata')));
            if (bumen === null||bumen==='')
            {
                this.jigoubumen=jigou;
            }else
            {
                this.jigoubumen=jigou+bumen;

            }
        }
    }
</script>

<style lang='scss'>
    .officeheader-title {
        color: #9a9a9a;
        font-size: 0.2rem;
        text-align: left;
        border-bottom: 1px solid #e5e5e5;
        padding-top: 0.25rem;
        padding-left: 0.5rem;
        padding-bottom: 0.15rem;
        background-color: #fafafa;
    }
    .officeedit {
        color: #e9b778;
        padding-right: 0.3rem;
        padding-left: 2rem;
        margin-top: -0.35rem;
        text-align: right;
        font-size: 0.25rem;
        float: right;


    }
    .officeleft {
        padding-left: 20px;
        float: left;
        margin-right: 1em;
        text-align: left;
        font-size: 0.25rem;
        color: #585858;
        width: 90%;
        height: 20%;
        margin-top: 10px;
    }
    .officeleft-title {
        padding-left: 20px;
        text-align: left;
        font-size: 0.25rem;
        color: #585858;
        margin-top: 20px;
        margin-bottom: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap; //文本不换行，这样超出一行的部分被截取，显示...

    }
    .officecenrer-title {
        padding-left: 20px;
        text-align: left;
        font-size: 0.20rem;
        color: #9a9a9a;
        margin-top: 20px;
        margin-bottom: 10px;

    }
    .officeright-title {
        text-align: right;
        font-size: 0.25rem;
        color: #585858;
        margin-top: 20px;
        padding-right: 20px;
        margin-bottom: 10px;

    }

</style>